package cn.ctodb.im.dto.auth;

import cn.ctodb.im.dto.AbstractDTO;
import cn.ctodb.im.proto.Auth;

/**
 * All rights Reserved, Designed By www.ctodb.cn
 *
 * @version V1.0
 * @author: lichaohn@163.com
 * @date: 2018-11-12 16:24
 * @Copyright: 2018 www.ctodb.cn All rights reserved.
 */
public class AuthReqDTO extends AbstractDTO<Auth.AuthReq> {

    private String token = "";
    private String uid = "";

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    @Override
    public void fromProto(Auth.AuthReq authReq) {
        setUid(authReq.getUid());
        setToken(authReq.getToken());
    }

    @Override
    public Auth.AuthReq toProto() {
        return Auth.AuthReq.newBuilder().setUid(getUid()).setToken(getToken()).build();
    }
}
